package com.flowershop.model;

import java.util.Date;
import java.math.BigDecimal;

public class CartItem {
    private Integer id;
    private Integer userId;
    private Integer flowerId;
    private Integer quantity;
    private Date createTime;
    private Date updateTime;
    
    // 用于显示的附加字段
    private String flowerName;
    private BigDecimal price;
    private String imageUrl;
    
    // Getters and Setters
    public Integer getId() {
        return id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    public Integer getUserId() {
        return userId;
    }
    
    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    
    public Integer getFlowerId() {
        return flowerId;
    }
    
    public void setFlowerId(Integer flowerId) {
        this.flowerId = flowerId;
    }
    
    public Integer getQuantity() {
        return quantity;
    }
    
    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }
    
    public Date getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    
    public Date getUpdateTime() {
        return updateTime;
    }
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    
    public String getFlowerName() {
        return flowerName;
    }
    
    public void setFlowerName(String flowerName) {
        this.flowerName = flowerName;
    }
    
    public BigDecimal getPrice() {
        return price;
    }
    
    public void setPrice(BigDecimal price) {
        this.price = price;
    }
    
    public String getImageUrl() {
        return imageUrl;
    }
    
    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }
    
    // 计算小计金额
    public BigDecimal getSubtotal() {
        return price.multiply(new BigDecimal(quantity));
    }
} 